package main

import "fmt"

func main() {
	var n, m, k int
	_, _ = fmt.Scan(&n, &m, &k)

	items := make([]int, n)
	for i := 0; i < n; i++ {
		_, _ = fmt.Scan(&items[i])
	}

	f(items, n, m, k)
}

func f(items []int, n, m, k int) {
	dp := make([]int, n)
	if items[0] >= k {
		dp[0] = 1
	}

	sum := 0
	for i := 1; i < n; i++ {
		if items[i] >= k {
			dp[i] = dp[i-1] + 1
			if dp[i] >= m {
				sum++
			}
		}
	}

	fmt.Println(sum)
}
